// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.
use crate::Result;

/// Implements a [AddressGroupService](super::stub::AddressGroupService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct AddressGroupService<T>
where
    T: super::stub::AddressGroupService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> AddressGroupService<T>
where
    T: super::stub::AddressGroupService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::AddressGroupService for AddressGroupService<T>
where
    T: super::stub::AddressGroupService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_address_groups(
        &self,
        req: crate::model::ListAddressGroupsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListAddressGroupsResponse>> {
        self.inner.list_address_groups(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_address_group(
        &self,
        req: crate::model::GetAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::AddressGroup>> {
        self.inner.get_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_address_group(
        &self,
        req: crate::model::CreateAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_address_group(
        &self,
        req: crate::model::UpdateAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn add_address_group_items(
        &self,
        req: crate::model::AddAddressGroupItemsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.add_address_group_items(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn remove_address_group_items(
        &self,
        req: crate::model::RemoveAddressGroupItemsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.remove_address_group_items(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn clone_address_group_items(
        &self,
        req: crate::model::CloneAddressGroupItemsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.clone_address_group_items(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_address_group(
        &self,
        req: crate::model::DeleteAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_address_group_references(
        &self,
        req: crate::model::ListAddressGroupReferencesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListAddressGroupReferencesResponse>> {
        self.inner.list_address_group_references(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [OrganizationAddressGroupService](super::stub::OrganizationAddressGroupService) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct OrganizationAddressGroupService<T>
where
    T: super::stub::OrganizationAddressGroupService + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> OrganizationAddressGroupService<T>
where
    T: super::stub::OrganizationAddressGroupService + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::OrganizationAddressGroupService for OrganizationAddressGroupService<T>
where
    T: super::stub::OrganizationAddressGroupService + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_address_groups(
        &self,
        req: crate::model::ListAddressGroupsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListAddressGroupsResponse>> {
        self.inner.list_address_groups(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_address_group(
        &self,
        req: crate::model::GetAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::AddressGroup>> {
        self.inner.get_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_address_group(
        &self,
        req: crate::model::CreateAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_address_group(
        &self,
        req: crate::model::UpdateAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn add_address_group_items(
        &self,
        req: crate::model::AddAddressGroupItemsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.add_address_group_items(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn remove_address_group_items(
        &self,
        req: crate::model::RemoveAddressGroupItemsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.remove_address_group_items(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn clone_address_group_items(
        &self,
        req: crate::model::CloneAddressGroupItemsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.clone_address_group_items(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_address_group(
        &self,
        req: crate::model::DeleteAddressGroupRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_address_group(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_address_group_references(
        &self,
        req: crate::model::ListAddressGroupReferencesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListAddressGroupReferencesResponse>> {
        self.inner.list_address_group_references(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}

/// Implements a [NetworkSecurity](super::stub::NetworkSecurity) decorator for logging and tracing.
#[derive(Clone, Debug)]
pub struct NetworkSecurity<T>
where
    T: super::stub::NetworkSecurity + std::fmt::Debug + Send + Sync,
{
    inner: T,
}

impl<T> NetworkSecurity<T>
where
    T: super::stub::NetworkSecurity + std::fmt::Debug + Send + Sync,
{
    pub fn new(inner: T) -> Self {
        Self { inner }
    }
}

impl<T> super::stub::NetworkSecurity for NetworkSecurity<T>
where
    T: super::stub::NetworkSecurity + std::fmt::Debug + Send + Sync,
{
    #[tracing::instrument(ret)]
    async fn list_authorization_policies(
        &self,
        req: crate::model::ListAuthorizationPoliciesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListAuthorizationPoliciesResponse>> {
        self.inner.list_authorization_policies(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_authorization_policy(
        &self,
        req: crate::model::GetAuthorizationPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::AuthorizationPolicy>> {
        self.inner.get_authorization_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_authorization_policy(
        &self,
        req: crate::model::CreateAuthorizationPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_authorization_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_authorization_policy(
        &self,
        req: crate::model::UpdateAuthorizationPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_authorization_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_authorization_policy(
        &self,
        req: crate::model::DeleteAuthorizationPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_authorization_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_server_tls_policies(
        &self,
        req: crate::model::ListServerTlsPoliciesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListServerTlsPoliciesResponse>> {
        self.inner.list_server_tls_policies(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_server_tls_policy(
        &self,
        req: crate::model::GetServerTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ServerTlsPolicy>> {
        self.inner.get_server_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_server_tls_policy(
        &self,
        req: crate::model::CreateServerTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_server_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_server_tls_policy(
        &self,
        req: crate::model::UpdateServerTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_server_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_server_tls_policy(
        &self,
        req: crate::model::DeleteServerTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_server_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_client_tls_policies(
        &self,
        req: crate::model::ListClientTlsPoliciesRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ListClientTlsPoliciesResponse>> {
        self.inner.list_client_tls_policies(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_client_tls_policy(
        &self,
        req: crate::model::GetClientTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<crate::model::ClientTlsPolicy>> {
        self.inner.get_client_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn create_client_tls_policy(
        &self,
        req: crate::model::CreateClientTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.create_client_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn update_client_tls_policy(
        &self,
        req: crate::model::UpdateClientTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.update_client_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_client_tls_policy(
        &self,
        req: crate::model::DeleteClientTlsPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.delete_client_tls_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_locations(
        &self,
        req: location::model::ListLocationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::ListLocationsResponse>> {
        self.inner.list_locations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_location(
        &self,
        req: location::model::GetLocationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<location::model::Location>> {
        self.inner.get_location(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn set_iam_policy(
        &self,
        req: iam_v1::model::SetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.set_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_iam_policy(
        &self,
        req: iam_v1::model::GetIamPolicyRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::Policy>> {
        self.inner.get_iam_policy(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn test_iam_permissions(
        &self,
        req: iam_v1::model::TestIamPermissionsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<iam_v1::model::TestIamPermissionsResponse>> {
        self.inner.test_iam_permissions(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        self.inner.list_operations(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<longrunning::model::Operation>> {
        self.inner.get_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.delete_operation(req, options).await
    }

    #[tracing::instrument(ret)]
    async fn cancel_operation(
        &self,
        req: longrunning::model::CancelOperationRequest,
        options: gax::options::RequestOptions,
    ) -> Result<gax::response::Response<()>> {
        self.inner.cancel_operation(req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        self.inner.get_polling_error_policy(options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        self.inner.get_polling_backoff_policy(options)
    }
}
